MathJax

MathJax is a way to display math formulas in the browser. The project is open source, and the scripts necessary to run MathJax are provided free from their server. For more information on MathJax see their homepage.

http://www.mathjax.org/

MathJax does its tricks with a sophisticated mixture of MathML, CSS, SVG and other ingredients, depending on the browser.

The pro and cons of MathJax are

+ the formulas scale better in some browsers,
+ the Latex code is not lost,
- the page loads slower.
- The browser cannot print the formula.

In Chrome, the quality of the images is on par with the quality of MathJax.

To demonstrate the Latex output, right click on the following formula, which is rendered by MathJax, and show the formula as Tex.

$$\frac{1+\sqrt{5}}{2}.$$

Also, try to enlarge the browser page Ctrl-+. Compare the quality of the rendering with the following image. The image will scale well too, but only on modern browsers like Chrome, if you select to link to the large graphics.

MathJax Test

Integration into Euler

As you know, Euler can render formulas using Latex. The images of the formulas can be exported as HTML. For print quality, by default a larger image is stored and linked from the HTML page.

Latex formualas occur in several places.

By the way, "&latex" is a synomym for "maxima:".

MathJax can be forced

These formulas will render with Latex by default for the display in Euler, but they will be displayed using MathJax after any HTML export. "&mathjax:" will run the formula through Maxima first.

Here is an example using

"&mathjax: solve(x^2-5*x+1)"

which runs the command through Maxima first.

$$\left[ x=-\frac{\sqrt{21}-5}{2} , x=\frac{\sqrt{21}+5}{2} \right] $$

You can also use MathJax for all formulas. For this enable "Export Latex as MathJax Formula for HTML".

Then you will have to rerun the notebook, including all comments. The reason is that only with this option, Euler saves the Latex formulas for maxima: and $...

Requirements

MathJax does not require much. It needs a script to be linked in the heading. The HTML export of Euler will do this automatically, if a MathJax formula is detected, or if a Latex formula is detected and all Latex formulas are exported for MathJax.

If you are using a pattern file, you are responsible for this script, since the header is in the pattern file. You can have a look at the source code of this page to see the link. For more information about pattern files, see the Euler documentation.

Printing

For best results on prints, Euler saves a larger version of the image for each formula and links the HTML page to this larger image. This should be sufficient to get good prints.

Note that there is an option to save larger images for graphics too. If you need high quality prints of your exported pages, you should enable this option.